<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>历史试卷</title>

    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/layui.css">
    <script src="/js/vue/vue.min.js"></script>
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/laypage/laypage.js" charset="utf-8"></script>
    <script src="/js/layer/layer.js" charset="utf-8"></script>

</head>
<body>

    <div class="container" id="pro">
        score_id = 1 的考试页面<br><br><br>


<#--判断-->
       <div>
           <span v-if="judge != null">判断题:</span>
           <ul>
               <li v-for="(pro,index) in judge">
                   <div>
                       <span>{{index+1}}:</span>
                       <span>{{pro.pname}}</span>
                   </div>
                   <ul v-for="(value,index) in pro.pchoice">
                       <li>{{value}}</li>
                   </ul><br><br>
                   <span class="alert alert-danger">正确答案是:{{pro.correctAnswer}}</span><br><br><br>
                   <span v-if="pro.studentAnswer == 'null'">
                       你怎么没写这一道题!!!<br><br>
                   </span>
                   <span v-else>
                        你的答案是:{{pro.studentAnswer}}
                   </span>
               </li>
           </ul>
       </div>

<#--单选 -->
        <div>
            <span v-if="only != null">单选题:</span>
            <ul>
                <li v-for="(pro,index) in only">
                    <div>
                        <span>{{index+1}}:</span>
                        <span>{{pro.pname}}</span>
                    </div>
                    <ul v-for="(value,key) in pro.pchoice">
                        <li>
                            <span>{{key}}</span>
                            <span>{{value}}:</span>
                        </li>
                    </ul><br><br>
                    <span class="alert alert-danger">正确答案是:{{pro.correctAnswer}}</span><br><br><br>
                    <span v-if="pro.studentAnswer == 'null'">
                       你怎么没写这一道题!!!<br><br>
                   </span>
                   <span v-else>
                        你的答案是:{{pro.studentAnswer}}
                   </span>
                </li>
            </ul>
        </div>

<#--多选题-->
        <span v-if="many != null">多选题:</span>
        <div>
            <ul>
               <li v-for="(pro,index) in many">

                  <div>
                      <span>{{index+1}}:</span>
                      <span>{{pro.pname}}</span>
                  </div>
                   <ul v-for="(value,key) in pro.pchoice">
                       <span>{{key}}</span>
                       <span>{{value}}:</span>
                   </ul>
                   <br><br>
                   <span class="alert alert-danger">正确答案是:{{pro.correctAnswer}}</span><br><br><br>
                   <span v-if="pro.studentAnswer == 'null'">
                       你怎么没写这一道题!!!<br><br>
                   </span>
                   <span v-else>
                        你的答案是:{{pro.studentAnswer}}
                   </span>
               </li>
            </ul>
        </div>


    </div>
<script>

    //加载做过的试卷
    function loadPaper() {

        $.ajax({
            type:"GET",
            dataType:"json",
            url:"/sj/history.do",

            success:function (msg) {
               pro.only = msg.only;
                pro.many = msg.many;
                pro.judge = msg.pd;

                //console.log(msg.only);
                //console.log(msg.pd);
            }
        });

    };

    loadPaper();
    var pro = new Vue({
        el:"#pro",
        data:{
            only:{},
            many:{},
            judge:{}
        }
    });

</script>

</body>
</html>